package com.lyc.day1104.demo01;

import java.util.function.BiPredicate;
import java.util.function.Predicate;

/**
 * @author ：Xiaochen
 * @date ：Created in 2022/11/4 19:30
 * @description：
 * @modified By：
 * @version:
 */
public class TestPredicate {
    public static void main(String[] args) {
        //根据传递的字符串，判断字符串的长度是否大于5
        //boolean test(T t); 方法中有且仅有一条语句，返回结果。则可以省略{}以及retur关键字
        Predicate<String> predicate=t->t.length()>5;

        boolean hello =predicate.test("hello");
        System.out.println(hello);


        BiPredicate<String,String> biPredicate=(t,u)->t.equals(u);

        boolean test = biPredicate.test("hello","hello");
        System.out.println(test);
    }
}